package com.java.comprehensive.arithmetic.leecode.easy;

/**
 * @program: comprehensive-service
 *
 * @description: 最后一个单词的长度
 *
 * @author: 窦绍飞
 *
 * @create: 2021-11-22 11:00
 **/
public class LeetCode_58 {

	public static int lengthOfLastWord(String s) {
		String[] split = s.split(" ");
		String s1 = split[split.length - 1];
		return s1.length();
	}

	public static void main(String[] args) {
		String s= "Hello World";
		System.out.println(lengthOfLastWord(s));
	}
}
